home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / pwd / pwd.h < prev    next >
C/C++ Source or Header  |  1992-05-22  |  3KB  |  93 lines

  1. /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /*
  20.  *    POSIX Standard: 9.2.2 User Database Access    <pwd.h>
  21.  */
  22.  
  23. #ifndef    _PWD_H
  24.  
  25. #define    _PWD_H    1
  26. #include <features.h>
  27.  
  28. __BEGIN_DECLS
  29.  
  30. #include <gnu/types.h>
  31.  
  32.  
  33. /* The passwd structure.  */
  34. struct passwd
  35. {
  36.   char *pw_name;        /* Username.  */
  37.   char *pw_passwd;        /* Password.  */
  38.   __uid_t pw_uid;        /* User ID.  */
  39.   __gid_t pw_gid;        /* Group ID.  */
  40.   char *pw_gecos;        /* Real name.  */
  41.   char *pw_dir;            /* Home directory.  */
  42.   char *pw_shell;        /* Shell program.  */
  43. };
  44.  
  45.  
  46. #if defined(__USE_SVID) || defined(__USE_GNU)
  47. #define    __need_FILE
  48. #include <stdio.h>
  49. #endif
  50.  
  51. #ifdef    __USE_GNU
  52. /* Return a new stream open on the password file.  */
  53. extern FILE *__pwdopen __P ((void));
  54.  
  55. /* Read a password entry from STREAM, filling in P.
  56.    Return the `struct passwd' of P if successful, NULL on failure.  */
  57. extern struct passwd *__pwdread __P ((FILE * __stream, __ptr_t __p));
  58.  
  59. /* Return a chunk of memory containing pre-initialized data for __pwdread.  */
  60. extern __ptr_t __pwdalloc __P ((void));
  61. #endif
  62.  
  63.  
  64. #if defined(__USE_SVID) || defined(__USE_MISC)
  65. /* Rewind the password-file stream.  */
  66. extern void setpwent __P ((void));
  67.  
  68. /* Close the password-file stream.  */
  69. extern void endpwent __P ((void));
  70.  
  71. /* Read an entry from the password-file stream, opening it if necessary.  */
  72. extern struct passwd *getpwent __P ((void));
  73. #endif
  74.  
  75. #ifdef    __USE_SVID
  76. /* Read an entry from STREAM.  */
  77. extern struct passwd *fgetpwent __P ((FILE * __stream));
  78.  
  79. /* Write the given entry onto the given stream.  */
  80. extern int putpwent __P ((__const struct passwd * __p, FILE * __f));
  81. #endif
  82.  
  83. /* Search for an entry with a matching user ID.  */
  84. extern struct passwd *getpwuid __P ((__uid_t __uid));
  85.  
  86. /* Search for an entry with a matching username.  */
  87. extern struct passwd *getpwnam __P ((__const char *__name));
  88.  
  89.  
  90. __END_DECLS
  91.  
  92. #endif /* pwd.h  */
  93.